import router from "./index.js";

//白名单
const whileList = ['/login']
//将导航首位挂载到$router
router.beforeEach((to, from, next) => {
    if (whileList.indexOf(to.path) !== -1) {
        next()
    } else {
        const token = window.sessionStorage.getItem('token')
        if (token) {
            next()
        }else {
            next('/')
        }
    }

})